package com.gitee.linzl;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

import lombok.extern.slf4j.Slf4j;

@Component
@FeignClient(value = "spring-hystrix-server", fallback = HystrixFeignFallback.class)
public interface HystrixFeign {
	@GetMapping(value = "/hi")
	String sayHiFromClientEureka();
}

@Slf4j
@Component
class HystrixFeignFallback implements HystrixFeign {
	@Override
	public String sayHiFromClientEureka() {
		log.error("触发HiHystrix熔断");
		return "hi,HiHystrix,sorry.error!";
	}
}